<script>
export default {
  onLaunch: function () {
    uni.addInterceptor('request', {
      invoke(args) {
        // request 触发前拼接 url 
        args.url = import.meta.env.VITE_API_URL + args.url
        args.header = { token: uni.getStorageSync('token'), ...args.header }
      },
    })
    uni.addInterceptor('uploadFile', {
      invoke(args) {
        // request 触发前拼接 url 
        args.url = import.meta.env.VITE_API_URL + args.url
        args.header = { token: uni.getStorageSync('token'), ...args.header }
      },
    })
    console.log('App Launch')
  },
  onShow: function () {
    console.log('App Show')
  },
  onHide: function () {
    console.log('App Hide')
  }
}
</script>

<style></style>
